package cn.com.lyj6851.modules.product.service;

import cn.com.lyj6851.common.service.BaseService;
import cn.com.lyj6851.domain.PageResult;
import cn.com.lyj6851.modules.product.domain.YdyStoreProductRelation;
import cn.com.lyj6851.modules.product.service.dto.YdyStoreProductRelationDto;
import cn.com.lyj6851.modules.product.service.dto.YdyStoreProductRelationQueryCriteria;
import cn.com.lyj6851.modules.product.vo.YdyStoreProductRelationQueryVo;
import org.springframework.data.domain.Pageable;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * <p>
 * 商品点赞和收藏表 服务类
 * </p>
 *
 */
public interface YdyStoreProductRelationService extends BaseService<YdyStoreProductRelation> {

    /**
     * 是否收藏
     * @param productId 商品ID
     * @param uid 用户ID
     * @return Boolean
     */
    Boolean isProductRelation(long productId, long uid);

    /**
     *添加收藏
     * @param productId 商品id
     * @param uid 用户id
     */
    void addRroductRelation(long productId,long uid);

    /**
     * 取消收藏
     * @param productId 商品id
     * @param uid 用户id
     */
    void delRroductRelation(long productId,long uid,String category);

    /**
     * 获取用户收藏列表
     * @param page page
     * @param limit limit
     * @param uid 用户id
     * @return list
     */
    List<YdyStoreProductRelationQueryVo> userCollectProduct(int page, int limit, Long uid, String type);

    /**
     * 查询数据分页
     * @param criteria 条件
     * @param pageable 分页参数
     * @return Map<String,Object>
     */
    PageResult<YdyStoreProductRelationDto> queryAll(YdyStoreProductRelationQueryCriteria criteria, Pageable pageable);

    /**
     * 查询所有数据不分页
     * @param criteria 条件参数
     * @return List<YdyStoreProductRelationDto>
     */
    List<YdyStoreProductRelation> queryAll(YdyStoreProductRelationQueryCriteria criteria);

    /**
     * 导出数据
     * @param all 待导出的数据
     * @param response /
     * @throws IOException /
     */
    void download(List<YdyStoreProductRelationDto> all, HttpServletResponse response) throws IOException;


}
